<%@page contentType="text/html;charset=utf-8"%>
<%@include file="../../core/common.jsp"%>
<html>
<head>
<title></title>
</head>
<body>
	<div class="easyui-panel" data-options="fit:true,border:false,footer:'#fb'">
		<table id="eg" class="easyui-edatagrid" data-options="url:'${CTX}/mgt/t/fxd/rkfx/find?cpbh=${param.cpbh}'">
			<thead>
				<tr>
					<th data-options="field:'cpbh',width:200">产品编号</th>
					<th data-options="field:'ys',width:200">元素名称</th>
					<th data-options="field:'rkfx',width:200" editor="{type:'textbox',options:{required:true,validType:'maxLength[50]'}}">入库分析</th>
				</tr>
			</thead>
		</table>
	</div>
	<div id="fb">
		<a id="save" class="form-btn success">确定</a>
	</div>
</body>
<script>
	$(function() {
		$('#save').click(function() {
			var data = $('#eg').edatagrid('getRows');
			for ( var i in data) {
				var rowIndex = $('#eg').edatagrid('getRowIndex', data[i]);
				$('#eg').edatagrid('beginEdit', rowIndex);
				if (!$('#eg').edatagrid('validateRow', rowIndex)) {
					return;
				}
				$('#eg').edatagrid('endEdit', rowIndex);
			}
			$.mask();
			$.ajax({
				url : '${CTX}/mgt/t/fxd/rkfx',
				data : {
					json : JSON.stringify(data)
				},
				success : function(data) {
					$.unmask();
					$.handle(data, function() {
						$.close();
					});
				}
			});
		});
	});
</script>
</html>